package org.darcy.controller.privilege;

import java.util.List;

import org.darcy.entity.privilege.SysMenu;
import org.darcy.framework.model.R;
import org.darcy.service.privilege.SysRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@Tag(name = "SysRoleMenuController接口：角色菜单管理")
@RestController
@RequestMapping("/privilege/rolemenu")
public class SysRoleMenuController {

	@Autowired
	private SysRoleMenuService SysRoleMenuService;

	@Operation(summary = "根据角色id获取菜单列表")
	@GetMapping("/getMenu/{roleId}")
	public R getMenu(@PathVariable Integer roleId) {
		List<SysMenu> data = SysRoleMenuService.getMenuList(roleId);
		return R.ok().data(data);
	}


}
